import VueRouter from 'vue-router';
import Vue from 'vue';

Vue.use(VueRouter);

// 路由懒加载
const routes = [
    {
        path: '/',
        component: () => import('../pages/homepage'),
        children: [
            { path: '/', component: () => import('../pages/dashboard') },
            { path: '/employees', component: () => import('../pages/employees') },
            { path: '/departments', component: () => import('../pages/departments') },
            { path: '/approvals', component: () => import('../pages/approvals') },
            { path: '/attendances', component: () => import('../pages/attendances') },
            { path: '/permissions', component: () => import('../pages/permissions') },
            { path: '/salary', component: () => import('../pages/salary') },
            { path: '/settings', component: () => import('../pages/settings') },
            { path: '/social_securitys', component: () => import('../pages/social_securitys') },
        ],
    },
    { path: '/login', component: () => import('../pages/login') },
];

export default new VueRouter({ routes });
